<%@page import="baytony.util.StringUtil"%>
<%@page import="baytony.util.Util"%>
<%@page import="java.util.List"%>
<%@page import="training.vo.Customer"%>
<%@page import="baytony.util.PagesUtil"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
int size=6;
PagesUtil<Customer> pages=(PagesUtil<Customer>)session.getAttribute("pages");
List<Customer> all=null;
if(pages!=null){
	all=pages.getFirstPage();
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">    
<title>Employee Table顯示畫面</title>
</head>
<script type="text/javascript">
<!--
function change_url(url){
	window.location =url;
}
-->
</script>
<body>
<br>
<br>
<center>
<table border="1">
		<thead>
		<tr>
			<th colspan="<%=size %>">Employees Table</th>
		</tr>
		<tbody>
		<%if(!Util.isEmpty(all)){ 
			for(Customer bean:all){
		%>
		<tr onclick="change_url('/JavaLab2/lab/cus/queryCustomer/<%=bean.getId()%>')">
			<td><%=StringUtil.trim(bean.getId()) %>&nbsp;</td>
			<td><%=StringUtil.trim(bean.getName()) %>&nbsp;</td>
			<td><%=StringUtil.trim(bean.getPassword()) %>&nbsp;</td>
			<td><%=StringUtil.trim(bean.getSalesId()) %>&nbsp;</td>
		</tr>
		<%}}else{ %>
		<tr>
			<td colspan="<%=size %>">查無資料</td>
		</tr>
		<%} %>
		</tbody>
</center>
</body>
</html>